package com.moyq5.permit.center.feign.client;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PatchMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.moyq5.mvc.framework.general.Body;
import com.moyq5.mvc.framework.general.PageData;
import com.moyq5.mvc.framework.general.Sorting;
import com.moyq5.mvc.framework.jackson.result.ListResult;
import com.moyq5.mvc.framework.jackson.result.ObjectResult;
import com.moyq5.mvc.framework.jackson.result.PageResult;
import com.moyq5.mvc.framework.jackson.result.StatusResult;
import com.moyq5.permit.center.bean.entity.MerchRole;
import com.moyq5.permit.center.bean.search.MerchRole4Search;
import com.moyq5.permit.center.bean.embed.MerchRoleId;

/**
 * @author Moyq5’s Tools
 * @since 2019-07-25 11:58:13
 */
@FeignClient(name="feign-server", url="${feign.server.url}")
@RequestMapping("/feign/merchRole")
public interface MerchRoleFeign {

	@PostMapping("/oneById?filter=")
	@ResponseBody
	ObjectResult<MerchRole> one(MerchRoleId id);
	
	@PostMapping("/count")
	@ResponseBody
	ObjectResult<Long> count(Body<MerchRole4Search, String> merchRole4s);
	
	@PostMapping("/one?filter=")
	@ResponseBody
	ObjectResult<MerchRole> one(Body<MerchRole4Search, Sorting> merchRole4s);
	
	@PostMapping("/list?filter=")
	@ResponseBody
	ListResult<MerchRole> list(Body<MerchRole4Search, Sorting> merchRole4s);

	@PostMapping("/page?filter=")
	@ResponseBody
	PageResult<MerchRole> page(Body<MerchRole4Search, PageData> merchRole4s);

	@PostMapping("/page?filter=role")
	@ResponseBody
	PageResult<MerchRole> pageWithRole(Body<MerchRole4Search, PageData> merchRole4s);

	@PostMapping("/page?filter=merchAndRole")
	@ResponseBody
	PageResult<MerchRole> pageWithMerchAndRole(Body<MerchRole4Search, PageData> merchRole4s);
	
	@PutMapping
	@ResponseBody
	ObjectResult<MerchRoleId> create(MerchRole merchRole);
	
	@PatchMapping
	@ResponseBody
	StatusResult update(MerchRole merchRole);
	
	@DeleteMapping
	@ResponseBody
	StatusResult remove(MerchRoleId id);

}
